Using dma for copying performance counter data to memory

ABSTRACT

A device for copying performance counter data includes hardware path that connects a direct memory access (DMA) unit to a plurality of hardware performance counters and a memory device. Software prepares an injection packet for the DMA unit to perform copying, while the software can perform other tasks. In one aspect, the software that prepares the injection packet runs on a processing core other than the core that gathers the hardware performance counter data.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. patent application Ser. No.12/684,367 filed on Jan. 8, 2010, the entire contents of which areincorporated herein by reference.

The present invention is related to the following commonly-owned,co-pending United States Patent Applications filed on even dateherewith, the entire contents and disclosure of each of which isexpressly incorporated by reference herein as if fully set forth herein.U.S. patent application Ser. No. 12/684,172, filed Jan. 8, 2010 for“HARDWARE SUPPORT FOR COLLECTING PERFORMANCE COUNTERS DIRECTLY TOMEMORY”; U.S. patent application Ser. No. 12/684,367, filed Jan. 8,2010, for “USING DMA FOR COPYING PERFORMANCE COUNTER DATA TO MEMORY”;U.S. patent application Ser. No. 12/684,190, filed Jan. 8, 2010, for“HARDWARE ENABLED PERFORMANCE COUNTERS WITH SUPPORT FOR OPERATING SYSTEMCONTEXT SWITCHING”; U.S. patent application Ser. No. 12/684,496, filedJan. 8, 2010, for “HARDWARE SUPPORT FOR SOFTWARE CONTROLLED FASTRECONFIGURATION OF PERFORMANCE COUNTERS”; U.S. patent application Ser.No. 12/684,429, filed Jan. 8, 2010, for “HARDWARE SUPPORT FOR SOFTWARECONTROLLED FAST MULTIPLEXING OF PERFORMANCE COUNTERS”; U.S. patentapplication Ser. No. 12/697,799, filed on Feb. 1, 2010, for “CONDITIONALLOAD AND STORE IN A SHARED CACHE”; U.S. patent application Ser. No.12/684,738, filed Jan. 8, 2010, for “DISTRIBUTED PERFORMANCE COUNTERS”;U.S. patent application Ser. No. 61/261,269, filed Nov. 13 2009, for“LOCAL ROLLBACK FOR FAULT-TOLERANCE IN PARALLEL COMPUTING SYSTEMS”; U.S.patent application Ser. No. 12/684,860, filed Jan. 8, 2010, for “PAUSEPROCESSOR HARDWARE THREAD UNTIL PIN”; U.S. patent application Ser. No.12/684,174, filed Jan. 8, 2010, for “PRECAST THERMAL INTERFACE ADHESIVEFOR EASY AND REPEATED, SEPARATION AND REMATING”; U.S. patent applicationSer. No. 12/684,184, filed Jan. 8, 2010, for “ZONE ROUTING IN A TORUSNETWORK”; U.S. patent application Ser. No. 12/684,852, filed Jan. 8,2010, for “PROCESSOR RESUME UNIT”; U.S. patent application Ser. No.12/684,642, filed Jan. 8, 2010, for “TLB EXCLUSION RANGE”; U.S. patentapplication Ser. No. 12/684,804, filed Jan. 8, 2010 , for “DISTRIBUTEDTRACE USING CENTRAL PERFORMANCE COUNTER MEMORY”; U.S. patent applicationSer. No. 13/008,602, filed Jan. 18, 2011, for “CACHE DIRECTORY LOOKUPREADER SET ENCODING FOR PARTIAL CACHE LINE SPECULATION SUPPORT”; U.S.patent application Ser. No. 61/293,237, filed Jan. 8, 2010, for“ORDERING OF GUARDED AND UNGUARDED STORES FOR NO-SYNC I/O”; U.S. patentapplication Ser. No. 12/693,972, filed Jan. 26, 2010, for “DISTRIBUTEDPARALLEL MESSAGING FOR MULTIPROCESSOR SYSTEMS”; U.S. patent applicationSer. No. 12/688,747, filed Jan. 15, 2010, for “SUPPORT FOR NON-LOCKINGPARALLEL RECEPTION OF PACKETS BELONGING TO A SINGLE MEMORY RECEPTIONFIFO”; U.S. patent application Ser. No. 12/688,773, filed Jan. 15, 2010,for “OPCODE COUNTING FOR PERFORMANCE MEASUREMENT”; U.S. patentapplication Ser. No. 12/684,776, filed Jan. 8, 2010, for “MULTI-INPUTAND BINARY REPRODUCIBLE, HIGH BANDWIDTH FLOATING POINT ADDER IN ACOLLECTIVE NETWORK”; U.S. patent application Ser. No. 13/004,007, filedJan. 10, 2011, for “MULTI-PETASCALE HIGHLY EFFICIENT PARALLELSUPERCOMPUTER”; U.S. patent application Ser. No. 12/984,252, filed Jan.4, 2011, for “CACHE WITHIN A CACHE”; U.S. patent application Ser. No.13/008,502, filed Jan. 18, 2011, for “MULTIPROCESSOR SYSTEM WITHMULTIPLE CONCURRENT MODES OF EXECUTION”; U.S. patent application Ser.No. 13/008,583, filed Jan. 18, 2011, for “READER SET ENCODING FORDIRECTORY OF SHARED CACHE MEMORY IN MULTIPROCESSOR SYSTEM”; U.S. patentapplication Ser. No. 12/984,308 filed on Jan. 4, 2011, for “EVICT ONWRITE, A MANAGEMENT STRATEGY FOR A PREFETCH UNIT AND/OR FIRST LEVELCACHE IN A MULTIPROCESSOR SYSTEM WITH SPECULATIVE EXECUTION”; U.S.patent application Ser. No. 12/984,329 filed Jan. 4, 2011, for “PHYSICALALIASING FOR THREAD LEVEL SPECULATION WITH A SPECULATION BLIND CACHE”;61/293,552, filed Jan. 8, 2010, for “LIST BASED PREFETCH”; U.S. patentapplication Ser. No. 12/684,693, filed Jan. 8, 2010, for “PROGRAMMABLESTREAM PREFETCH WITH RESOURCE OPTIMIZATION”; U.S. patent applicationSer. No. 13/004,005, filed Jan. 10, 2011, for “NON-VOLATILE MEMORY FORCHECKPOINT STORAGE”; U.S. patent application Ser. No. 61/293,476, filedJan. 8, 2010, for “NETWORK SUPPORT FOR SYSTEM INITIATED CHECKPOINTS”;U.S. patent application Ser. No. 12/696,746, filed on Jan. 29, 2010, for“TWO DIFFERENT PREFETCH COMPLEMENTARY ENGINES OPERATING SIMULTANEOUSLY”;U.S. patent application Ser. No. 12/697,015, filed on Jan. 29, 2010, for“DEADLOCK-FREE CLASS ROUTES FOR COLLECTIVE COMMUNICATIONS EMBEDDED IN AMULTI-DIMENSIONAL TORUS NETWORK”; U.S. patent application Ser. No.61/293,559, filed Jan. 8, 2010, for “RELIABILITY AND PERFORMANCE OF ASYSTEM-ON-A-CHIP BY PREDICTIVE WEAR-OUT BASED ACTIVATION OF FUNCTIONALCOMPONENTS”; U.S. patent application Ser. No. 12/727,984, filed Mar. 19,2010, for “EFFICIENCY OF STATIC CORE TURN-OFF IN A SYSTEM-ON-A-CHIP WITHVARIATION”; U.S. patent application Ser. No. 12/697,043, Jan. 29, 2010,for “IMPLEMENTING ASYNCHRONOUS COLLECTIVE OPERATIONS IN A MULTI-NODEPROCESSING SYSTEM”; U.S. patent application Ser. No. 13/008,546, filedJan. 18, 2011, for “ATOMICITY: A MULTI-PRONGED APPROACH”; U.S. patentapplication Ser. No. 12/697,175 , filed Jan. 29, 2010 for “I/O ROUTINGIN A MULTIDIMENSIONAL TORUS NETWORK”; U.S. patent application Ser. No.12/684,287, filed Jan. 8, 2010 for ARBITRATION IN CROSSBAR FOR LOWLATENCY; U.S. patent application Ser. No. 12/684,630, filed Jan. 8, 2010, for “EAGER PROTOCOL ON A CACHE PIPELINE DATAFLOW”; U.S. patentapplication Ser. No.12/723,277, filed Mar. 12, 2010 for EMBEDDED GLOBALBARRIER AND COLLECTIVE IN A TORUS NETWORK; U.S. patent application Ser.No. 12/696,764, filed Jan. 29, 2010 for “GLOBAL SYNCHRONIZATION OFPARALLEL PROCESSORS USING CLOCK PULSE WIDTH MODULATION”; U.S. patentapplication Ser. No. 12/796,411, filed Jun. 8, 2010 for“GENERATION-BASED MEMORY SYNCHRONIZATION IN A MULTIPROCESSOR SYSTEM WITHWEAKLY CONSISTENT MEMORY ACCESSES”; U.S. patent application Ser. No.12/796,389, filed Jun. 8, 2010 for BALANCING WORKLOAD IN AMULTIPROCESSOR SYSTEM RESPONSIVE TO PROGRAMMABLE ADJUSTMENTS IN ASYNCRONIZATION INSTRUCTION; U.S. patent application Ser. No. 12/696,817,filed Jan. 29, 2010 for HEAP/STACK GUARD PAGES USING A WAKEUP UNIT; U.S.patent application Ser. No. 61/293,603, filed Jan. 8, 2010 for MECHANISMOF SUPPORTING SUB-COMMUNICATOR COLLECTIVES WITH O(64) COUNTERS ASOPPOSED TO ONE COUNTER FOR EACH SUB-COMMUNICATOR; and U.S. patentapplication Ser. No. 12/774,475, filed May 5, 2010 for “REPRODUCIBILITYIN A MULTIPROCESSOR SYSTEM”.

STATEMENT REGARDING FEDERALLY SPONSORED RESEARCH OR DEVELOPMENT

This invention was made with Government support under Contract No.:B554331 awarded by Department of Energy. The Government has certainrights in this invention.

FIELD OF THE INVENTION

The present disclosure relates generally to performance counters, andmore particularly to hardware support for efficiently copyingperformance counter data to memory.

BACKGROUND

Understanding the performance of programs running on today's chips iscomplicated. Programs themselves are becoming increasingly complex andintertwined with a growing number of layers in the software stack.Hardware chips are also becoming more complex. The current generation ofchips is multicore and the next generation will likely have even morecores and will include networking, switches, and other componentsintegrated on to the chip.

Performance counters can help programmers address the challenges createdby the above complexity by providing insight into what is happeningthroughout the chip, in the functional units, in the caches, and in theother components on the chip. Performance counter data also helpsprogrammers understand application behavior. Chips have incorporatedperformance counters for several generations, and software ecosystemshave been designed to help analyze the data provided by such counters.

Hardware performance counters provide insight into the behavior of thevarious aspects of a chip. Generally, hardware performance counters areextra logic added to the central processing unit (CPU) to tracklow-level operations or events within the processor. For example, thereare counter events that are associated with the cache hierarchy thatindicate how many misses have occurred at L1, L2, and the like. Othercounter events indicate the number of instructions completed, number offloating point instructions executed, translation lookaside buffer (TLB)misses, and others. Depending on the chip, there are different numbersof counters available that provide information about the chip. However,most chip architectures only allow a small subset of these potentialcounters to be counted simultaneously. Among the limitations ofperformance counters are the number of counters that may be gatheredsimultaneously and the rate at which the data may be gathered.

There are several engineering reasons why it is difficult to gather alarge number of counters. One is that some of the useful data originatesin areas of the chip where area is a very scarce resource. Anotherreason is that trying to provide paths and multiplexers to export manycounters takes power and area that is not available. Counters themselvesare implemented as latches, and a large number of large counters requirelarge area and power. What is needed is an efficient mechanism to bestutilize the limited performance counters that are available.

Software uses the values from performance counters. To get these values,performance counters have to explicitly be read out. Depending where thecounters are located, they are read out either as a set of registers, oras a set of memory locations (memory mapped registers—MMRs). The code toread the counters implements one load instruction for each read requestfor each counter. For a system with larger number of counters, and/orwhere the counter access latency is large, reading out all counters willhave longer latency and will block the processor handling this functioncall during that time.

BRIEF SUMMARY

A device and method for copying performance counter data are provided.The device, in one aspect, may include at least one processor core, amemory, and a plurality of hardware performance counters operable tocollect counts of selected hardware-related activities. A direct memoryaccess unit includes a DMA controller operable to copy data between thememory and the plurality of hardware performance counters. Aninterconnecting path connects the processor core, the memory, theplurality of hardware performance counters, and the direct memory accessunit.

A method of copying performance counter data, in one aspect, may includeestablishing a path between a direct memory access unit to a pluralityof hardware performance counter units, the path further connecting to amemory device. The method may also include initiating a direct memoryaccess unit to copy data between the plurality of hardware performancecounter units and the memory device.

A computer readable storage medium storing a program of instructionsexecutable by a machine to perform one or more methods described hereinalso may be provided.

Further features as well as the structure and operation of variousembodiments are described in detail below with reference to theaccompanying drawings. In the drawings, like reference numbers indicateidentical or functionally similar elements.

BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS

FIG. 1 illustrates an architectural diagram showing using DMA forcopying performance counter data to memory.

FIG. 2 is a flow diagram illustrating a method for using DMA for copyingperformance counter data to memory.

FIG. 3 is a flow diagram illustrating a method for using DMA for copyingperformance counter data to memory in another aspect.

FIG. 4 illustrates an example of a computer system, in which the systemsand methodologies of the present disclosure may be carried out orexecuted.

DETAILED DESCRIPTION

A mechanism for transferring the performance counter data between theperformance counters and memory provided in the present disclosure maybe efficient and non-obtrusive. At the outset, it should be understoodthat while the description herein refers to multicore chips, themechanism of the present disclosure is not limited to work only onmulticore chips, and is not dependent on the number of cores orprocessors a chip may have. For example, the mechanism of the presentdisclosure may apply to a single processor, a uniprocessor chip, andothers.

Multicore chips are those computer chips with more than a single core.The extra cores may be used to offload the work of setting up a transferof data between the performance counters and memory without perturbingthe data being generated from the running application. A direct memoryaccess (DMA) mechanism allows software to specify a range of memory tobe copied from and to, and hardware to copy all of the memory in thespecified range. Many chip multiprocessors (CMP) and systems on a chip(SoC) integrate a DMA unit. The DMA engine is typically used tofacilitate data transfer between network devices and the memory, orbetween I/O devices and memory, or between memory and memory.

Many chip architectures include a performance monitoring unit (PMU).This unit contains a number of performance counters that count a numberof events in the chip. The performance counters are typicallyprogrammable to select particular events to count. This unit can countevents from some or all of the processors and from other components inthe system, such as the memory system, or the network system.

If software wants to use the values from performance counters, it has toread performance counters. Counters are read out using a softwareprogram which reads the memory area where performance counters aremapped by reading counters sequentially. For a system with large numberof counters or with large counter access latency, executing the code toget these counter values has a substantial impact on programperformance.

The mechanism of the present disclosure combines hardware and softwarethat allows for efficient, non-obtrusive movement of hardwareperformance counter data between the registers that hold that data and aset of memory locations. To be able to utilize a hardware DMA unitavailable on the chip for copying performance counters into the memory,the hardware DMA unit is connected via paths to the hardware performancecounters and registers. The DMA is initialized to perform data copy inthe same way it is initialized to perform the copy of any other memoryarea, by specifying the starting source address, the startingdestination address, and the data size of data to be copied. Byoffloading data copy from a processor to the DMA engine, the datatransfer may occur without disturbing the core on which the measuredcomputation or operation (i.e., monitoring and gathering performancecounter data) is occurring.

A register/memory location provides the start memory location of thefirst destination memory address. For example, the software, or anoperating system, or the like pre-allocates memory area to provide spacefor writing and storing the performance counter data. Additionalregister and/or memory location provides the start memory location ofthe first source memory address. This source address corresponds to thememory address of the first performance counter to be copied. Additionalregister and/or memory location provides the size of data to be copied,or number of performance counters to be copied.

On a multicore chip, for example, the software running on an extra core,i.e., one not dedicated to gather performance data, may decide which ofthe performance counters to copy, utilize the DMA engine by setting upthe copy, initiate the copy, and then proceed to perform otheroperations or work.

FIG. 1 illustrates an architectural diagram showing using DMA forcopying performance counter data to memory. DMA unit 106, performancecounter unit 102, and L2 cache or another type of memory device 108 areconnected on the same interconnect 110. A performance counter unit 102may be built into a microprocessor and includes a plurality of hardwareperformance counters 104, which are registers used to store the countsof hardware-related activities within a computer. Examples of activitiesof which the counters 104 may store counts may include, but are notlimited to, cache misses, translation lookaside buffer (TLB) misses, thenumber of instructions completed, number of floating point instructionsexecuted, processor cycles, input/output (I/O) requests, and otherhardware-related activities and events. A memory device 108, which maybe an L2 cache or other memory, stores various data related to therunning of the computer system and its applications.

Both the performance counter unit 102 and the memory 108 are accessiblefrom the DMA unit 106. An operating system or software may allocate anarea in memory 108 for storing the counter data of the performancecounters 104. The operating system or software may decide whichperformance counter data to copy, whether the data is to be copied fromthe performance counters 104 to the memory 108 or the memory 108 to theperformance counters 104, and may prepare a packet for DMA and injectthe packet into the DMA unit 106, which initiates memory-to-memory copy,i.e., between the counters 104 and memory 108. In one aspect, thecontrol packet for DMA may contain a packet type identification, whichspecifies that this is a memory-to-memory transfer, a starting sourceaddress of data to be copied, size in bytes of data to be copied, and adestination address where the data are to be copied. The sourceaddresses may map to the performance counter device 102, and destinationaddress may map to the memory device 108 for data transfer from theperformance counters to the memory.

In another aspect, data transfer can be performed in both directions,not only from the performance counter unit to the memory, but also fromthe memory to the performance counter unit. Such a transfer may be usedfor restoring the value of the counter unit, for example.

Multiple cores 112 may be running different processes, and in oneaspect, the software that prepares the DMA packet and initiates the DMAdata transfer may be running on a core that is separate from the processrunning on another core that is gathering the hardware performancemonitoring data. In this way, the core running a measure computation,i.e., that gathers the hardware performance monitoring data, need not bedisturbed or interrupted to perform the copying to and from the memory108.

FIG. 2 is a flow diagram illustrating a method for using DMA for copyingperformance counter data to memory. At 202, software sets up a DMApacket that specifies at least which performance counters are involvedin copying, the memory location in memory device that is involved incopying. At 204, the software injects the DMA packet into the DMA unit,which invokes the DMA unit to perform the specified copy. At 206, thesoftware is free to perform its other tasks. At 208, asynchronous to thesoftware performing other tasks, the DMA unit performs the instructedcopy between the performance counters and the memory as directed in theDMA packet. In one embodiment, the software that prepares and injectsthe DMA packet runs on one core on a microprocessor, and is a separateprocess from the process that may be gathering the measurement data forthe performance counters, which may be running on a different core.

FIG. 3 is a flow diagram illustrating a method for using DMA for copyingperformance counter data to memory in another aspect. At 302,destination address and source address are specified. The operatingsystem or another software may specify the destination address andsource address, for example, in a DMA packet. At 304, data size andnumber of counters are specified. Again, the operating system or anothersoftware may specify the data size and number of counters to copy in theDMA packet. At 306, a DMA device checks the address range specified inthe packet and if not correct, an error signal is generated at 308. TheDMA device then waits for next packet. If the address range is correctat 306, the DMA device starts copying the counter data at 310. At 312,the DMA device performs a store to the specified memory address. At 314,the destination address is incremented by the length of counter datacopied. At 316, if not all counters have been copied, the controlreturns to 312 to perform the next copy. If all counters have beencopied, the control returns to 302.

As will be appreciated by one skilled in the art, aspects of the presentinvention may be embodied as a system, method or computer programproduct. Accordingly, aspects of the present invention may take the formof an entirely hardware embodiment, an entirely software embodiment(including firmware, resident software, micro-code, etc.) or anembodiment combining software and hardware aspects that may allgenerally be referred to herein as a “circuit,” “module” or “system.”Furthermore, aspects of the present invention may take the form of acomputer program product embodied in one or more computer readablemedium(s) having computer readable program code embodied thereon.

Any combination of one or more computer readable medium(s) may beutilized. The computer readable medium may be a computer readable signalmedium or a computer readable storage medium. A computer readablestorage medium may be, for example, but not limited to, an electronic,magnetic, optical, electromagnetic, infrared, or semiconductor system,apparatus, or device, or any suitable combination of the foregoing. Morespecific examples (a non-exhaustive list) of the computer readablestorage medium would include the following: an electrical connectionhaving one or more wires, a portable computer diskette, a hard disk, arandom access memory (RAM), a read-only memory (ROM), an erasableprogrammable read-only memory (EPROM or Flash memory), an optical fiber,a portable compact disc read-only memory (CD-ROM), an optical storagedevice, a magnetic storage device, or any suitable combination of theforegoing. In the context of this document, a computer readable storagemedium may be any tangible medium that can contain, or store a programfor use by or in connection with an instruction execution system,apparatus, or device.

A computer readable signal medium may include a propagated data signalwith computer readable program code embodied therein, for example, inbaseband or as part of a carrier wave. Such a propagated signal may takeany of a variety of forms, including, but not limited to,electro-magnetic, optical, or any suitable combination thereof. Acomputer readable signal medium may be any computer readable medium thatis not a computer readable storage medium and that can communicate,propagate, or transport a program for use by or in connection with aninstruction execution system, apparatus, or device.

Program code embodied on a computer readable medium may be transmittedusing any appropriate medium, including but not limited to wireless,wireline, optical fiber cable, RF, etc., or any suitable combination ofthe foregoing.

Computer program code for carrying out operations for aspects of thepresent invention may be written in any combination of one or moreprogramming languages, including an object oriented programming languagesuch as Java, Smalltalk, C++ or the like and conventional proceduralprogramming languages, such as the “C” programming language or similarprogramming languages. The program code may execute entirely on theuser's computer, partly on the user's computer, as a stand-alonesoftware package, partly on the user's computer and partly on a remotecomputer or entirely on the remote computer or server. In the latterscenario, the remote computer may be connected to the user's computerthrough any type of network, including a local area network (LAN) or awide area network (WAN), or the connection may be made to an externalcomputer (for example, through the Internet using an Internet ServiceProvider).

Aspects of the present invention are described below with reference toflowchart illustrations and/or block diagrams of methods, apparatus(systems) and computer program products according to embodiments of theinvention. It will be understood that each block of the flowchartillustrations and/or block diagrams, and combinations of blocks in theflowchart illustrations and/or block diagrams, can be implemented bycomputer program instructions. These computer program instructions maybe provided to a processor of a general purpose computer, specialpurpose computer, or other programmable data processing apparatus toproduce a machine, such that the instructions, which execute via theprocessor of the computer or other programmable data processingapparatus, create means for implementing the functions/acts specified inthe flowchart and/or block diagram block or blocks.

These computer program instructions may also be stored in a computerreadable medium that can direct a computer, other programmable dataprocessing apparatus, or other devices to function in a particularmanner, such that the instructions stored in the computer readablemedium produce an article of manufacture including instructions whichimplement the function/act specified in the flowchart and/or blockdiagram block or blocks.

The computer program instructions may also be loaded onto a computer,other programmable data processing apparatus, or other devices to causea series of operational steps to be performed on the computer, otherprogrammable apparatus or other devices to produce a computerimplemented process such that the instructions which execute on thecomputer or other programmable apparatus provide processes forimplementing the functions/acts specified in the flowchart and/or blockdiagram block or blocks.

The flowchart and block diagrams in the figures illustrate thearchitecture, functionality, and operation of possible implementationsof systems, methods and computer program products according to variousembodiments of the present invention. In this regard, each block in theflowchart or block diagrams may represent a module, segment, or portionof code, which comprises one or more executable instructions forimplementing the specified logical function(s). It should also be notedthat, in some alternative implementations, the functions noted in theblock may occur out of the order noted in the figures. For example, twoblocks shown in succession may, in fact, be executed substantiallyconcurrently, or the blocks may sometimes be executed in the reverseorder, depending upon the functionality involved. It will also be notedthat each block of the block diagrams and/or flowchart illustration, andcombinations of blocks in the block diagrams and/or flowchartillustration, can be implemented by special purpose hardware-based basedsystems that perform the specified functions or acts, or combinations ofspecial purpose hardware and computer instructions.

Referring now to FIG. 4, the systems and methodologies of the presentdisclosure may be carried out or executed in a computer system thatincludes a processing unit 2, which houses one or more processors and/orcores, memory and other systems components (not shown expressly in thedrawing) that implement a computer processing system, or computer thatmay execute a computer program product. The computer program product maycomprise media, for example a hard disk, a compact storage medium suchas a compact disc, or other storage devices, which may be read by theprocessing unit 2 by any techniques known or will be known to theskilled artisan for providing the computer program product to theprocessing system for execution.

The computer program product may comprise all the respective featuresenabling the implementation of the methodology described herein, andwhich—when loaded in a computer system—is able to carry out the methods.Computer program, software program, program, or software, in the presentcontext means any expression, in any language, code or notation, of aset of instructions intended to cause a system having an informationprocessing capability to perform a particular function either directlyor after either or both of the following: (a) conversion to anotherlanguage, code or notation; and/or (b) reproduction in a differentmaterial form.

The computer processing system that carries out the system and method ofthe present disclosure may also include a display device such as amonitor or display screen 4 for presenting output displays and providinga display through which the user may input data and interact with theprocessing system, for instance, in cooperation with input devices suchas the keyboard 6 and mouse device 8 or pointing device. The computerprocessing system may be also connected or coupled to one or moreperipheral devices such as the printer 10, scanner (not shown), speaker,and any other devices, directly or via remote connections. The computerprocessing system may be connected or coupled to one or more otherprocessing systems such as a server 10, other remote computer processingsystem 14, network storage devices 12, via any one or more of a localEthernet, WAN connection, Internet, etc. or via any other networkingmethodologies that connect different computing systems and allow them tocommunicate with one another. The various functionalities and modules ofthe systems and methods of the present disclosure may be implemented orcarried out distributedly on different processing systems (e.g., 2, 14,16), or on any single platform, for instance, accessing data storedlocally or distributedly on the network.

The terminology used herein is for the purpose of describing particularembodiments only and is not intended to be limiting of the invention. Asused herein, the singular forms “a”, “an” and “the” are intended toinclude the plural forms as well, unless the context clearly indicatesotherwise. It will be further understood that the terms “comprises”and/or “comprising,” when used in this specification, specify thepresence of stated features, integers, steps, operations, elements,and/or components, but do not preclude the presence or addition of oneor more other features, integers, steps, operations, elements,components, and/or groups thereof.

The corresponding structures, materials, acts, and equivalents of allmeans or step plus function elements, if any, in the claims below areintended to include any structure, material, or act for performing thefunction in combination with other claimed elements as specificallyclaimed. The description of the present invention has been presented forpurposes of illustration and description, but is not intended to beexhaustive or limited to the invention in the form disclosed. Manymodifications and variations will be apparent to those of ordinary skillin the art without departing from the scope and spirit of the invention.The embodiment was chosen and described in order to best explain theprinciples of the invention and the practical application, and to enableothers of ordinary skill in the art to understand the invention forvarious embodiments with various modifications as are suited to theparticular use contemplated.

Various aspects of the present disclosure may be embodied as a program,software, or computer instructions embodied in a computer or machineusable or readable medium, which causes the computer or machine toperform the steps of the method when executed on the computer,processor, and/or machine. A program storage device readable by amachine, tangibly embodying a program of instructions executable by themachine to perform various functionalities and methods described in thepresent disclosure is also provided.

The system and method of the present disclosure may be implemented andrun on a general-purpose computer or special-purpose computer system.The computer system may be any type of known or will be known systemsand may typically include a processor, memory device, a storage device,input/output devices, internal buses, and/or a communications interfacefor communicating with other computer systems in conjunction withcommunication hardware and software, etc.

The terms “computer system” and “computer network” as may be used in thepresent application may include a variety of combinations of fixedand/or portable computer hardware, software, peripherals, and storagedevices. The computer system may include a plurality of individualcomponents that are networked or otherwise linked to performcollaboratively, or may include one or more stand-alone components. Thehardware and software components of the computer system of the presentapplication may include and may be included within fixed and portabledevices such as desktop, laptop, server. A module may be a component ofa device, software, program, or system that implements some“functionality”, which can be embodied as software, hardware, firmware,electronic circuitry, or etc.

The embodiments described above are illustrative examples and it shouldnot be construed that the present invention is limited to theseparticular embodiments. Thus, various changes and modifications may beeffected by one skilled in the art without departing from the spirit orscope of the invention as defined in the appended claims.

1. A device for copying performance counter data, comprising: at leastone processing core; a memory; a plurality of hardware performancecounters operable to collect counts of selected hardware-relatedactivities; a direct memory access unit having a DMA controller operableto copy data between the memory and the plurality of hardwareperformance counters; and an interconnecting path connecting theprocessing core, the memory, the plurality of hardware performancecounters, and the direct memory access unit.
 2. The device of claim 1,wherein software running on the processing core sets up a DMA injectionpacket and initiates the DMA controller to copy data between one or moreof the plurality of hardware performance counters and the memory.
 3. Thedevice of claim 2, wherein the DMA controller provides for copying datafrom the memory to one or more of the plurality of hardware performancecounters.
 4. The device of claim 2, wherein the DMA injection packetincludes at least a memory address of the memory and one or more of theplurality of hardware performance counters.
 5. The device of claim 2,wherein the DMA unit operates independently of the software after thesoftware initiates the DMA controller.
 6. The device of claim 2, whereinthe device includes a plurality of processing cores operable to runsoftware and one of the plurality of processing cores is operable forgathering hardware performance counter data.
 7. A method of copyingperformance counter data, comprising: establishing a path between adirect memory access unit to a plurality of hardware performance units,the path further connecting to a memory device; and initiating a directmemory access unit to copy data between the plurality of hardwareperformance units and the memory device.
 8. The method of claim 7,further including: software setting up a DMA injection packet toinitiate the direct memory access unit for copying.
 9. The method ofclaim 7, wherein the direct memory access unit operates independently ofsoftware running on a plurality of cores.
 10. The method of claim 7,wherein software runs on a plurality of processing cores, while anotherprocessing core is responsible for gathering hardware performancecounter data.
 11. The method of claim 7, wherein the direct memoryaccess unit copies data from one or more of the plurality of hardwareperformance units to the memory device.
 12. The method of claim 7,wherein the direct memory access unit copies data from the memory deviceto the one or more of the plurality of hardware performance units. 13.The method of claim 7, wherein the initiating a direct memory accessunit to copy data include injecting a packet to the direct memory accessunit.
 14. The method of claim 13, wherein the packet comprises at leasta number of hardware performance counters from which to copy data or towhich to copy data.
 15. A computer readable storage medium storing aprogram of instructions executable by a machine to perform a methodcopying performance counter data, comprising: establishing a pathbetween a direct memory access unit to a plurality of hardwareperformance units, the path further connecting to a memory device; andinitiating a direct memory access unit to copy data between theplurality of hardware performance units and the memory device.
 16. Thecomputer readable storage medium of claim 15, further including:software setting up a DMA injection packet to initiate the direct memoryaccess unit for copying.
 17. The computer readable storage medium ofclaim 16, wherein the software runs on one processing core, whileanother processing core is responsible for gathering hardwareperformance counter data.
 18. The computer readable storage medium ofclaim 15, wherein the initiating a direct memory access unit to copydata include injecting a packet to the direct memory access unit. 19.The computer readable storage medium of claim 18, wherein the packetcomprises at least a number of hardware performance counters from whichto copy data or to which to copy data.